﻿<html DIR="LTR" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
  <head>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8" />
    <META NAME="save" CONTENT="history" />
    <title>区域字符集支持</title>
    
    <link rel="stylesheet" type="text/css" href="../local/Classic.css">
      
    </link>
    
    <script src="../local/script.js">
      
    </script><script src="../local/script_main.js">&amp;nbsp;</script>
  </head>
  <body>
    <!--Topic built:04/01/2010 05:03:28-->

    
    
    
    
    
    
    
    
    
    <div id="header">
      <table width="100%" id="topTable"><tr>
          <td align="left">
            <span id="headerBold">区域字符集支持</span>
          </td>
          <td align="right">
            
          </td>
        </tr></table>
      
      
      
    </div>
    <div id="mainSection">
      
        
        
    <font color="DarkGray">
      
    </font>
    <p />
    
    <p />
  
        <div id="introductionSection" class="section">
    <p>从 Microsoft SQL Server JDBC Driver 2.0 开始，JDBC driver 支持 JDBC 4.0 API，后者包括新的区域字符集转换 API 方法。该支持包括用于 <b>NCHAR</b>、<b>NVARCHAR</b>、<b>LONGNVARCHAR</b> 和 <b>NCLOB</b> JDBC 类型的新增 setter、getter 和 updater 方法。</p>
    <p>下面是支持区域字符集转换的新增 getter、setter 和 updater 方法的列表：</p>
    <ul><li>
        
          <a href="a8481c06-fbba-432b-8c69-4f4619c20ad4.htm">SQLServerPreparedStatement</a>：<a href="b7da6d44-f5b1-44f8-95f5-40179968b1b0.htm">setNString</a>、<a href="2c245f0e-85ec-4d94-93ac-4957aa52b984.htm">setNCharacterStream</a>、<a href="7ec1d24d-f732-44f3-9608-734ce2df4489.htm">setNClob</a>。<br />
      </li><li>
        
          <a href="30710a63-c05d-47d9-9cf9-c087a1c76373.htm">SQLServerCallableStatement</a>：<a href="9a86daeb-03b2-45ef-82d3-495f33fb0113.htm">getNClob</a>、<a href="5ac360e8-a1ee-4577-93b4-bb2018f1087a.htm">getNString</a>、<a href="e4f1e99c-4c7a-4c83-b202-4608538ab50b.htm">getNCharacterStream</a>、<a href="6494300b-7fc0-4076-8311-22d35a96cdc6.htm">setNString</a>、<a href="77905630-0135-46ad-a419-215e648996e2.htm">setNCharacterStream</a>、<a href="fd972acc-57e5-4971-9744-0e8fca5f05a6.htm">setNClob</a>。<br />
      </li><li>
        
          <a href="eaffcff1-286c-459f-83da-3150778480c9.htm">SQLServerResultSet</a>：<a href="432901eb-57b6-44ad-98b4-43164bcbc2b6.htm">getNClob</a>、<a href="023a238b-37f2-4966-bc91-ef2b22aebc46.htm">getNString</a>、<a href="69620047-78fd-4be9-a245-1851afaeac1b.htm">getNCharacterStream</a>、<a href="0cb0d347-4449-4920-b382-05f88f2a3225.htm">updateNClob</a>、<a href="0b6b65a1-8e62-4cd5-ab28-6231c3e20d81.htm">updateNString</a>、<a href="d6a21d01-6d8e-4449-9fdf-ddb09bd4fdb8.htm">updateNCharacterStream</a>。<br />
      </li></ul>
    <div style="margin: .5em 1.5em .5em 1.5em"><b>注意：</b>
      要在应用程序中使用这些方法，必须将 classpath 设置为包含 sqljdbc4.jar 文件。<p />
    </div>
    <p>若要以 Unicode 格式发送 String 参数，应用程序应当使用新的 JDBC 4.0 区域字符方法；如果使用非区域字符方法，则应当将 <b>sendStringParametersAsUnicode</b> 连接属性设置为“<b>true</b>”。建议尽可能使用新的 JDBC 4.0 区域字符方法。有关 <b>sendStringParametersAsUnicode</b> 连接属性的详细信息，请参阅<a href="f1b62700-f046-488d-bd6b-a5cd8fc345b7.htm">设置连接属性</a>。</p>
  </div><span id="seeAlsoSpan"><h1 class="heading">请参阅</h1></span><div id="seeAlsoSection" class="section" name="collapseableSection"><a href="7802328d-4d23-4775-9573-4169b127d258.htm">了解 JDBC 驱动程序数据类型</a><br /><br /></div><!--[if gte IE 5]>
			<tool:tip element="seeAlsoToolTip" avoidmouse="false"/><tool:tip element="languageFilterToolTip" avoidmouse="false"/><tool:tip element="roleInfoSpan" avoidmouse="false"/>
		<![endif]-->
      <div id="footer" class="section">
        
		<hr />
		
		<span id="fb" class="feedbackcss">
			
			
		</span>
		
		<a href="9bad553b-9e70-4696-8499-2e35f772a1e0.htm">
			
			© 2010 Microsoft Corporation。保留所有权利。
		</a>
 	
	
      </div>
    </div>
  </body>
</html>